package com.nbsaas.boot.shop.rest.convert;

import com.nbsaas.boot.shop.data.entity.ShopCheckIn;
import com.nbsaas.boot.shop.api.domain.simple.ShopCheckInSimple;

import com.nbsaas.boot.rest.api.Converter;

/**
* -列表对象转换器
*/

public class ShopCheckInSimpleConvert implements Converter<ShopCheckInSimple, ShopCheckIn> {




@Override
public ShopCheckInSimple convert(ShopCheckIn source) {
    ShopCheckInSimple result = new ShopCheckInSimple();


               try {
                   if(source.getShop()!=null){
                       result.setShop(source.getShop().getId());
                   }
                } catch (Exception ignored) { }

                result.setLatitude(source.getLatitude());

                try {
                    if(source.getShop()!=null){
                        result.setShopName(source.getShop().getName());
                    }
                } catch (Exception ignored) { }

                result.setComment(source.getComment());
                result.setGps(source.getGps());
                result.setId(source.getId());

               try {
                   if(source.getUser()!=null){
                       result.setUser(source.getUser().getId());
                   }
                } catch (Exception ignored) { }

                result.setAddDate(source.getAddDate());
                result.setLongitude(source.getLongitude());
                result.setLastDate(source.getLastDate());


    return result;
}

}